package homework.day12;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;

public class Test02 {
    public static void main(String[] args) {
        LinkedList<String>  list1=new LinkedList<>();
        ArrayList<String> list= new ArrayList<>();
        list.add("一") ;
        list.add("二") ;
        list.add("三") ;
        list.add("四") ;
        list.add("五") ;
        System.out.println(list);
        System.out.println(list.get(2));
        System.out.println(list.remove(1));
        System.out.println(list);
        System.out.println("======");
        list.add(2,"run");
        Iterator<String> iter=list.iterator();
        while (iter.hasNext()){
            System.out.println(iter.next());


        }
        System.out.println("======");
        for (String q:list){
            System.out.println(q);
        }
    }

}
